#include "widget.h"
#include "ui_widget.h"
#include<QPainter>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
}

Widget::~Widget()
{
    delete ui;
}
void Widget::paintEvent(QPaintEvent *event)
{

    //基础设置图片
    QPainter painter(this);
    QPixmap pixmap(":/666.jpg");
    painter.drawPixmap(0,0,pixmap);

    //图片缩放
    painter.drawPixmap(100,100,400,300,pixmap);

    //图片旋转
    painter.rotate(180);  //围绕图片的起点顺时针绕180度
    painter.translate(-800,-600); //坐标变换
}

